Skip to content

Expose request timing#735

Merged
hadley merged 6 commits into
r-lib:mainfrom
arcresu:req-timing
Jun 16, 2025
Merged

Expose request timing#735
hadley merged 6 commits into
r-lib:mainfrom
arcresu:req-timing

Conversation

@arcresu
Copy link
Copy Markdown
Contributor

@arcresu arcresu commented Jun 12, 2025

Add a new function to expose request timing information from curl. Closes #725.

I wasn't sure about the need to validate the timing vector's type when creating the response but had a shot at that.

The R library curl doesn't document the specific elements of the timing vector, but they do correspond to the naming of the enum in libcurl so I thought it was useful to mention that.

Copy link
Copy Markdown
Member

@hadley hadley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this! I've provided some detailed feedback below just to get everything perfect 😄

Comment thread R/resp-timing.R Outdated
Comment thread R/resp-timing.R Outdated
Comment thread R/resp-timing.R Outdated
Comment thread tests/testthat/test-resp-timing.R Outdated
@arcresu
Copy link
Copy Markdown
Contributor Author

arcresu commented Jun 16, 2025

Thanks for the comments! I've made some doc changes. The CI failure doesn't seem to be related.

@@ -0,0 +1,4 @@
test_that("can extract request timing", {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@arcresu I figured it was easier to just make the change than try to explain it further. And now that I've done it, I can express what I was picking up on more clearly: it's worth partitioning your test into two pieces, one that tests we are correctly setting the values, and one that tests we are correctly getting the values.

@hadley hadley merged commit cbbd151 into r-lib:main Jun 16, 2025
12 of 13 checks passed
@hadley
Copy link
Copy Markdown
Member

hadley commented Jun 16, 2025

Thanks for your help with this!

@arcresu arcresu deleted the req-timing branch June 16, 2025 23:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Capture request timings

2 participants